package demo07;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Test01 {
	public static void main(String[] args) {
		 String[] arr = {"z, h, a, n, g", "s, a, n"};
		    List<String> list = Arrays.asList(arr);
		    System.out.println(list);
		    List<String> collect = list.stream().flatMap(x -> {
		        String[] array = x.split(",");
		        Stream<String> stream = Arrays.stream(array);
		        return stream;
		    }).collect(Collectors.toList());
		    System.out.println(collect);

	}
}
